package com.aca.tool;

import com.opensymphony.xwork2.ActionInvocation;
import com.aca.entity.Admin;
import java.util.Map;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
public class AuthorityFilter extends AbstractInterceptor{

    @Override
    public String intercept(ActionInvocation arg0) throws Exception {
        Map session = arg0.getInvocationContext().getSession();
        Admin admin = (Admin) session.get("admin");
        if (admin.getAuth() != 1) {
            return Action.NONE;
        }
            return arg0.invoke();
    }
}
